<?php
/**
 * Formulário padrão
 */
class App_Form_Login extends Voitech_Form
{
	public function __construct($options=array())
	{
            parent::__construct($options);

            $this->setAttribs(array('name'=>'frmCadastroLogin', 'id'=>'frmCadastroLogin', 'class'=>'form last-child','style'=>'width:400px'));
            $this->setAction(PATHAMBIENTE."autenticacao/logar");
		
            $noLogin 	= new Zend_Form_Element_Text( 'no_usuario' );
            $noLogin->setLabel( 'Usuário:' )
                             ->setAttribs( array('size'=>'55') )
                             ->addFilter( new Zend_Filter_StringTrim() )
                             ->addValidator( new Zend_Validate_StringLength( array( 'min'=>'3', 'max'=>'40' ) ) )
                             ->setDecorators( $this->_decoratorDefault )
                             ->setRequired( true );
            $this->addElement( $noLogin );		
            
            $noSenha 	= new Zend_Form_Element_Password( 'ds_senha' );
            $noSenha->setLabel( 'Senha:' )
                             ->setAttribs( array('size'=>'55') )
                             ->addFilter( new Zend_Filter_StringTrim() )
                             ->addValidator( new Zend_Validate_StringLength( array( 'min'=>'3', 'max'=>'40' ) ) )
                             ->setDecorators( $this->_decoratorDefault )
                             ->setRequired( true );
            $this->addElement( $noSenha );		

            $buttonCdst = new Zend_Form_Element_Submit('Entrar');
            $buttonCdst->setAttribs( array('class'=> 'first-child last-child','style'=>'float:right; margin-top: 17px', 'id' => 'btnLogar' ) )
                       ->setDecorators( $this->_decoratorDefault )
                       ->removeDecorator( 'label' );
            $this->addElement( $buttonCdst );

            $this->addDisplayGroup(array('no_usuario','ds_senha','Entrar'),'Cadastro',array('legend' => 'Entrar no sistema', 'class'=>'grey-bg first-child last-child fieldset-with-legend fieldset-with-legend-first-child'));
	}
}